/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-01-27
 * Time: 10:49
 */
public class j_subject {

    //找到1-100中既能被3整除，又能被5整除的数字
    public static void main(String[] args) {
        int i = 0;
        while (i <= 100) {
            if (i % 5 != 0 || i % 3 != 0) {
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }


    }

    //: 计算 1! + 2! + 3! + 4! + 5!
    public static void main2(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            int j = i;
            while (j >= 0) {
                sum += j * i;
                j--;
            }
        }
        System.out.println(sum);
    }

    //计算5的阶乘
    public static void main1(String[] args) {
        int sum = 1;
        for (int i = 5; i > 0; i--) {
            sum *= i;
        }
        System.out.println(sum);
    }
}
